package com.qingxin.sys.filter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

import com.qingxin.sys.support.UploadFile;


/**
 * 内容上下文拦截器
 * @author Administrator
 *
 */
public class ResponseInterceptor extends BaseInterceptor {
	
	
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        if(!shouldIntercept(request)){
            	return true;
        }
        return true;
    }

    
    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView mav)
            throws Exception {
    	if(request.getAttribute("_pass_request_interceptor") == null){
    		return;
    	}
    	
    	String path = request.getContextPath();
		request.setAttribute("path", path);
		request.setAttribute("filepath", UploadFile.getFileContentPath());
		request.setAttribute("fdirs", UploadFile.getFileDirMap());
		
    }
    
    
    
}